1. Field of the Invention
The present invention relates to an image processing method for a visual sensor for object recognition which is utilized as a visual organ of an industrial robot or the like.
2. Description of the Related Art
In conventional practices, a visual sensor is incorporated in a production line, and the respective positions and attitudes of objects to be detected, which are successively fed onto the production line, are detected in succession by means of the visual sensor. The detected data are transformed into the data for the coordinate system of a machine, such as a robot, and are transmitted as correction data to the robot or other machine. Then, the operation of the robot or the machine is corrected in accordance with the received correction data.
In order to obtain the correction data, according to a system utilizing the visual sensor arranged in the above-described manner, teaching data are needed in order to process an image photographed by a camera, identify the object and detect the position and attitude thereof. In such a conventional method, however, these teaching data used to be set by detecting the value of a parameter for adjustment from one image (sample) of the object.
It is impossible, however, to check if the teaching data obtained in the aforesaid manner represent the average data of the detected objects which have been successively fed to the production line. In some cases, if the objects successively delivered to the production line are subject to change with the passage of time, the current teaching data has to be modified to cope with such a situation. For example, when the teaching data for detecting a hole in a component is obtained from a sample, those components which are successively fed to the line may have a little oil sticking to their holes from a certain point of time and on. In such a case, this teaching data is no longer proper for the detection of those holes, thus requiring a modification.
Thus, in order to evaluate whether or not the teaching data once established suits the present situation, or in order to modify the teaching data for higher reliability, it is necessary to review as many previously processed image data as possible. The storage capacity of a frame memory of the visual sensor is extremely limited, so that as many image data as necessary cannot be stored and retained under normal conditions. More specifically, an image photographed by the camera in response to a snap command is stored in the image memory (frame memory) after undergoing the processing for the gray scale shading by means of an image processor. Normally, a gray scale image in the frame memory has a capacity of 256xc3x97256xc3x971 bytes, and the number of image data the frame memory can store ranges from about 4 to 20 on account of restrictions on the part of the hardware.
When unsuccessful processing such as a failure in detection or wrong detection has occurred, the resulting defective image must be investigated to determine the cause of the failure. Since the conventional visual sensor has no means for storing or retaining the defective image, in order to determine the cause of such failure, the current operation has to be interrupted in order to pick up again the object viewed by the camera.
An object of the present invention is to provide an image processing method for an industrial visual sensor, capable of obtaining proper teaching data based on a number of past image data and examining the cause of unsuccessful processing, if any, after operation is finished.
In order to achieve the above object, according to the present invention, a frame memory is loaded with image data of an object of detection photographed by a camera; the image data are then read from the frame memory; identification data are annexed to the read data; and the resulting data are transferred to and stored in an auxiliary storage device. In examining the image data, the image data stored in the auxiliary storage device are restored from the auxiliary storage device to the frame memory, and the display of the restored image data and an image processing program are reproductively executed with reference to relevant data annexed to the image data.
Preferably, the identification data include at least one of the following: data for specifying the image data or a detected value for the image data, program name, calibration data, correction data, and the like; when the visual sensor includes a plurality of cameras, identification data of a camera used to fetch the image concerned is annexed to the aforesaid identification data; furthermore identification data indicative of unsuccessful processing, such as a failure in detection, if any, is annexed to the identification data.
Preferably, a large-capacity storage device, such as an optical disk, photomagnetic disk, hard disk, cassette streamer or DAT, is used as the auxiliary storage device.
Preferably, of those image data stored in the frame memory, all those of unsuccessful detection are transferred to the auxiliary storage device for storage, while only some of the normally detected image data are selectively transferred and stored according to a predetermined basis.
According to the present invention, as described above, the auxiliary storage device is attached to the industrial visual sensor so that each image data photographed by the camera and stored in the frame memory are annexed with necessary identification data, and are transferred to the auxiliary storage device to be stored and retained therein. In determining or examining whether initially established teaching data is appropriate or not, or in investigating the cause of unsuccessful processing, if any, after the end of the operation, the image data saved in the auxiliary storage device are transferred individually to the frame memory, and the past image processing program is reproductively executed. Thus, a number of image data processed before the production line is stopped can be saved and reproduced, so that the reliability of the established teaching data can be evaluated afterward. Thus, in further executing the image processing after this point, whether the currently established teaching data should be modified or not can be determined, and, moreover, the propriety of the result of actual modification can be examined by using the saved image data. Also, detection failure of the visual sensor can be reproduced afterward without stopping the production line on the spot, thereby enabling the necessary improvement of the visual sensor system for a higher operating efficiency.